<template>
  <div>
    <BaseBillButtonGroup @add="addBill" @save="print" @gotoList="gotoList" historyBtnText="检索" printText="取血凭证打印"
      :hiddenAdd="true" :hiddenSave="true" />
    <MkCard>
      <div>
        <MkPatient class="patientClass" v-model="patient" />
      </div>
      <div class="applyInfoClass">
        <span>申请单:{{ patient.billNo }}</span>
        <span>用血类型:{{ patient.type }}</span>
        <span>复核血型:{{ patient.abo }}</span>
        <span>输血目的:{{ patient.applyPurpose }}</span>
        <span>诊断:{{ patient.clinicDiagnose }}</span>
      </div>
      <div class="reviewInfoClass">
        <span>复核血型:{{ patient.abo }}</span>
      </div>
      <div class="tableClass">
        <MkTable style="max-width: 600px;" :data="varieryList">
          <MkColumn label="申请品种" align="center" width="150px" prop="varietyName" />
          <MkColumn label="申请量" header-align="center" width="100px" prop="varietySum" />
          <MkColumn label="血型" header-align="center" width="100px" prop="abo" />
          <MkColumn label="特殊处理" header-align="center" width="250px" prop="spesc" />
        </MkTable>
      </div>
    </MkCard>
    <MkCard>
      <BeiXueXueYeInfo title="备血血液信息" :data="dataList">
        <MkColumnXueYe />
        <MkColumn label="库存状态" minWidth="120px" prop="status" />
      </BeiXueXueYeInfo>
    </MkCard>
  </div>
</template>

<script lang="ts" setup>
import BeiXueXueYeInfo from './components/BeiXueXueYeInfo.vue';
const patient = ref({
  patientCode: '2025012311',
  billNo: '20250329001',
  applyPurpose: '治疗用血',
  type: '紧急',
  name: '张三',
  sex: '男',
  age: '30',
  height: 175,
  weight: 70,
  abo: 'A',
  rhD: '+',
  birthday: '1993-05-10',
  apanage: '北京',
  berth: '302',
  courtArea: 'A区',
  diseaseArea: '内科',
  department: '心内科',
  transfuseHistory: '无',
  reactionHistory: '无',
  gestationHistory: '无',
  parturitionHistory: '无',
  transplantMatchHistory: '无',
  basSingleDiseaseCode: 'D001',
  clinicDiagnose: '冠心病',
  checkBloodAbo: 'A',
  checkBloodRh: '+',
  seeDoctorType: '住院',
  visitCount: 2,
  info1: '有家族心脏病史',
  info2: '偶尔胸痛',
  info3: '',
  info4: ''
})
const varieryList = ref([{
  varietyName: '品种1',
  varietySum: '1u',
  abo: 'A+',
  spesc: '无'
}, {
  varietyName: '品种2',
  varietySum: '1u',
  abo: 'A+',
  spesc: '无',
}])
const dataList = ref([{
  id: 1,
  bloodDonationCode: '440152202500001',
  basBloodProductCode: 'BPC001',
  basBloodProductName: '红细胞悬液',
  courtArea: '院区A',
  abo: 'A',
  rhD: '+',
  volume: 2,
  unit: 'u',
  price: 250,
  status: '在库',
  effectiveDate: '2025-03-15',
  gatheringDate: '2025-02-20',
  makeDate: '2025-02-20',
  bloodStation: '血站A',
  bloodAppearance: '正常'
}, {
  id: 2,
  bloodDonationCode: '440152202500002',
  basBloodProductCode: 'BPC002',
  basBloodProductName: '洗涤红细胞',
  courtArea: '院区B',
  abo: 'B',
  rhD: '+',
  volume: 2,
  unit: 'u',
  price: 450,
  status: '在库',
  effectiveDate: '2025-03-20',
  gatheringDate: '2025-02-21',
  makeDate: '2025-02-21',
  bloodStation: '血站B',
  bloodAppearance: '正常'
}, {
  id: 3,
  bloodDonationCode: '440152202500003',
  basBloodProductCode: 'BPC003',
  basBloodProductName: '新鲜冰冻血浆',
  courtArea: '院区A',
  abo: 'AB',
  rhD: '+',
  volume: 150,
  unit: 'ml',
  price: 300,
  status: '在库',
  effectiveDate: '2025-03-25',
  gatheringDate: '2025-02-22',
  makeDate: '2025-02-22',
  bloodStation: '血站A',
  bloodAppearance: '正常'
},
{
  id: 4,
  bloodDonationCode: '440152202500004',
  basBloodProductCode: 'BPC004',
  basBloodProductName: '机采血小板',
  courtArea: '院区C',
  abo: 'O',
  rhD: '+',
  volume: 1,
  unit: 'u',
  price: 350,
  status: '在库',
  effectiveDate: '2025-03-30',
  gatheringDate: '2025-02-23',
  makeDate: '2025-02-23',
  bloodStation: '血站C',
  bloodAppearance: '正常'
},
{
  id: 5,
  bloodDonationCode: '440152202500005',
  basBloodProductCode: 'BPC005',
  basBloodProductName: '冰冻血浆',
  courtArea: '院区B',
  abo: 'A',
  rhD: '+',
  volume: 50,
  unit: 'ml',
  price: 400,
  status: '在库',
  effectiveDate: '2025-03-18',
  gatheringDate: '2025-02-24',
  makeDate: '2025-02-24',
  bloodStation: '血站B',
  bloodAppearance: '正常'
},
{
  id: 6,
  bloodDonationCode: '440152202500006',
  basBloodProductCode: 'BPC006',
  basBloodProductName: '冷沉淀',
  courtArea: '院区A',
  abo: 'B',
  rhD: '+',
  volume: 1,
  unit: 'u',
  price: 450,
  status: '在库',
  effectiveDate: '2025-03-22',
  gatheringDate: '2025-02-25',
  makeDate: '2025-02-25',
  bloodStation: '血站A',
  bloodAppearance: '正常'
},
{
  id: 7,
  bloodDonationCode: '4401522025000015',
  basBloodProductCode: 'BPC013',
  basBloodProductName: '血浆',
  basBloodVarietyId: 4,
  courtArea: '院区C',
  abo: 'AB',
  rhD: '+',
  volume: 300,
  unit: 'ml',
  price: 280,
  status: '在库',
  effectiveDate: '2025-03-28',
  gatheringDate: '2025-02-26',
  makeDate: '2025-02-26',
  bloodStation: '血站C',
  bloodAppearance: '正常'
},
{
  id: 8,
  bloodDonationCode: '4401522025000025',
  basBloodProductCode: 'BPC015',
  basBloodProductName: '血浆',
  basBloodVarietyId: 4,
  courtArea: '院区B',
  abo: 'O',
  rhD: '-',
  volume: 350,
  unit: 'ml',
  price: 320,
  status: '在库',
  effectiveDate: '2025-03-31',
  gatheringDate: '2025-02-27',
  makeDate: '2025-02-27',
  bloodStation: '血站B',
  bloodAppearance: '正常'
},
])
const addBill = () => { }
const print = () => { }
const emits = defineEmits(['goto-list'])
const gotoList = () => {
  emits('goto-list')
}
</script>

<style lang="scss" scoped>
.patientClass {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  padding: 1rem 1em;
}

.applyInfoClass {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  font-size: 1.5rem;
  font-weight: 800;
  padding: 1rem 0rem;

  span {
    padding-right: 2%;
  }
}

.reviewInfoClass {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  font-size: 1.5rem;
  font-weight: 800;
  padding: 0rem 1em 1em 0rem;

  span {
    padding-right: 2%;
  }
}

.tableClass {
  width: 100%;
  padding: 0rem 1em 1em 0rem;
}
</style>